//
//  registerViewController.m
//  A段项目,漫画
//
//  Created by dlios on 15-4-23.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "registerViewController.h"
#define WIDTH self.view.frame.size.width
#define HEIGHT self.view.frame.size.height
@interface registerViewController ()

@end

@implementation registerViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationItem.title = @"注册";
    
    [self creatRegisterView];
    
}

#pragma mark 注册视图设置
-(void)creatRegisterView
{
    //账号
    self.registerNameText = [[UITextField alloc]initWithFrame:CGRectMake(50, 84, WIDTH - 100, 50)];
    self.registerNameText.layer.borderWidth = 1;
    self.registerNameText.layer.cornerRadius = 5;
    self.registerNameText.placeholder = @"邮箱:请输入邮箱地址";
    self.registerNameText.textAlignment = NSTextAlignmentCenter;
    self.registerNameText.clearButtonMode = UITextFieldViewModeAlways;
    self.registerNameText.keyboardType = UIKeyboardTypeEmailAddress;
    [self.view addSubview:self.registerNameText];
    [_registerNameText release];
    
    
    
    //密码
    self.registerPawwWordText = [[UITextField alloc]initWithFrame:CGRectMake(50, 144, WIDTH - 100, 50)];
    self.registerPawwWordText.layer.borderWidth = 1;
    self.registerPawwWordText.layer.cornerRadius = 5;
    self.registerPawwWordText.placeholder = @"密码:6~20个字母区分大小写";
    self.registerPawwWordText.textAlignment = NSTextAlignmentCenter;
    self.registerPawwWordText.clearButtonMode = UITextFieldViewModeAlways;
    self.registerPawwWordText.keyboardType = UIKeyboardTypeEmailAddress;
    [self.view addSubview:self.registerPawwWordText];
    [_registerPawwWordText release];
    
    
    //提交
    self.submitButton = [UIButton buttonWithType:UIButtonTypeSystem];
    self.submitButton.frame = CGRectMake(60, 204, WIDTH - 115, 50);
    [self.view addSubview:self.submitButton];
    [self.submitButton setTitle:@"提交" forState:UIControlStateNormal];
    [self.submitButton addTarget:self action:@selector(clickToLoginView:) forControlEvents:UIControlEventTouchUpInside];
    self.submitButton.layer.borderWidth = 1;
    self.submitButton.layer.cornerRadius = 5;
    
    
    
}


//按钮点击方法
-(void)clickToLoginView:(UIButton *)sender
{
    UIAlertView *alter = [[UIAlertView alloc]initWithTitle:@"恭喜" message:@"注册成功" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
    [alter show];
    [alter release];
    NSLog(@"注册完成,返回登录界面");
    [self.navigationController popToRootViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
